-- GENERATED SPELL FOR [Morta'gya the Keeper] --


function spell0_8636(pUnit, Event) --@Renew,Heal--
pUnit:FullCastSpellOnTarget(11640,pUnit)
pUnit:RegisterEvent('Sorts_8636', 15000, 1)
end

function spell1_8636(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(9613,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_8636', 3000, 1)
end

function spell2_8636(pUnit, Event) --@Shadow Word: Pain,n/a--
pUnit:FullCastSpellOnTarget(11639,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_8636', 18000, 1)
end

function Sorts_8636(pUnit, Event)
local choix_sorts_8636 = math.random(0, 2)
if choix_sorts_8636 == 0 then
pUnit:RegisterEvent('spell0_8636', 1, 1)
end
if choix_sorts_8636 == 1 then
pUnit:RegisterEvent('spell1_8636', 1, 1)
end
if choix_sorts_8636 == 2 then
pUnit:RegisterEvent('spell2_8636', 1, 1)
end
end

function mob8636_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_8636', math.random(1500, 3000), 1)
end

function mob8636_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob8636_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob8636_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(8636, 1, 'mob8636_Action')
RegisterUnitEvent(8636, 2, 'mob8636_Leave')
RegisterUnitEvent(8636, 3, 'mob8636_Kill')
RegisterUnitEvent(8636, 4, 'mob8636_Die')
